﻿
@using InputType = Ext.Net.InputType
@model CuongHanh.Models.User
@{
    ViewBag.Title = "Đăng nhập";
    Layout = "~/Views/Shared/_ALayout.cshtml";

}


@(Html.X()
      .Window()
      .Title("Đăng Nhập")
      .Modal(true)
      .Resizable(false)
      .Constrain(true)
      .Draggable(false)
      .Width(400)
      .Height(175)
      .Listeners(c => c.BeforeClose.Handler = "return false;")
      .Items(view =>
             
                 view.Add(Html.X()
                              .FormPanel()
                              .ID("loginform")
                              .Url(Url.Action("Login"))
                              .Method(HttpMethod.POST)
                              .Height(135)
                              .Items(c =>
                                     {
                                         c.Add(Html.X()
                                                   .TextFieldFor(m => m.Username)
                                                   .FieldLabel("Username")
                                                   .AllowBlank(false)
                                                   .PaddingSpec("10px 0 0 20px")
                                                   .Width(350));
                                         c.Add(Html.X()
                                                   .TextFieldFor(m => m.Password)
                                                   .InputType(InputType.Password)
                                                   .FieldLabel("Password")
                                                   .AllowBlank(false)
                                                   .PaddingSpec("5px 0 0 20px")
                                                   .Width(350));
                                         c.Add(Html.X()
                                                   .CheckboxFor(m => m.RememberMe)
                                                   .FieldLabel("")
                                                   .BoxLabel("Remember me?")
                                                   .PaddingSpec("5px 0 0 125px"));
                                     })
                              .Buttons(b =>
                                       
                                           
                                           b.Add(Html.X()
                                                     .Button()
                                                     .FormBind(true)
                                                     .Type(ButtonType.Button)
                                                     .Text("Đăng nhập")
                                                     .MarginSpec("0 20px 0 0")
                                                     .Icon(Icon.Accept)
                                                     .Listeners(ls => ls.Click.Handler = @"this.up('form').submit({
                                                                                                         success : function (form, action) {
                                                                                                             eval(action.result.script);
                                                                                                         }
                                                                                                     });"))
                                       ))

               
             ))